<?php

namespace App\Admin\Services;
use App\Models\PositionMonthTarget;

/**
 * Created by PhpStorm.
 * User: 共赢岛
 * Date: 2024/6/21
 * Time: 15:32
 */
class PositionMonthTargetService
{
    public static function isTarget($param = [])
    {
        $id = $param['id'];
        unset($param['id']);

        $target = PositionMonthTarget::where($param)->first();

        if ($target) {
            if ($id == $target->id) {
                return false;
            } else {
                return true;
            }
        }

        return false;
    }

    public static function one($id)
    {
        return PositionMonthTarget::find($id);
    }
}